<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组去重</title>
</head>
<body>
<script>
    <!--        -->
    const array = [5, 4, 7, 8, 9, 2, 7, 5];
    array.filter((item, idx, arr) => arr.indexOf(item) === idx);
    console.log('%c   array: ','color: MidnightBlue; background: Aquamarine; font-size: 20px;', array);
    // or
    const nonUnique = [...new Set(array)];
    console.log('%c   nonUnique: ','color: MidnightBlue; background: Aquamarine; font-size: 20px;', nonUnique);
    // Output: [5, 4, 7, 8, 9, 2]

</script>
</body>
</html>